#include<iostream>
using namespace std;
int main(){
 int a,n;
    int b=0,c=0,i=1;
    scanf("%d%d",&a,&n);
 while(i<= n){   
        c = c + a;
        b = b + c; 
        a = a * 10; 
        i++;
	}   
	printf("%d",b);
}
